
;/*****************************************************************************/
;/*  Startup for IAR                                                          */
;/*  Version     V1.0.4                                                         */
;/*  Date        2024-06-03                                                   */
;/*  Target-mcu  SYM32L010xxxx                                                */
;/*****************************************************************************/


                MODULE  ?cstartup

                ;; Forward declaration of sections.
                SECTION CSTACK:DATA:NOROOT(3)

                EXTERN  __iar_program_start
                EXTERN  SystemInit
                PUBLIC  __vector_table

                SECTION .intvec:CODE:ROOT(8)
                DATA
__vector_table
                DCD     sfe(CSTACK)               ; Top of Stack
                DCD     Reset_Handler             ;< -15 Reset Vector, invoked on Power up and warm reset
                DCD     NMI_Handler               ;< -14 Non maskable Interrupt, cannot be stopped or preempted
                DCD     HardFault_Handler         ;< -13 Hard Fault, all classes of Fault
                DCD     0                         ;< -12 Reserved
                DCD     0                         ;< -11 Reserved
                DCD     0                         ;< -10 Reserved
                DCD     0                         ;< -9 Reserved
                DCD     0                         ;< -8 Reserved
                DCD     0                         ;< -7 Reserved
                DCD     0                         ;< -6 Reserved
                DCD     SVC_Handler               ;< -5 System Service Call via SVC instruction
                DCD     0                         ;< -4 Reserved
                DCD     0                         ;< -3 Reserved
                DCD     PendSV_Handler            ;< -2 Pendable request for system service
                DCD     SysTick_Handler           ;< -1 System Tick Timer

; Numbered IRQ handler vectors

; Note: renaming to device dependent ISR function names are done in

                DCD     WDT_IRQHandler            ;< 0 WDT Interrupt Handler
                DCD     LVD_IRQHandler            ;< 1 LVD Interrupt Handler
                DCD     RTC_IRQHandler            ;< 2 RTC Interrupt Handler
                DCD     FLASH_RAM_IRQHandler      ;< 3 Flash/RAM Interrupt Handler
                DCD     SYSCTRL_IRQHandler        ;< 4 SYSCTRL Interupt Handler
                DCD     GPIOA_IRQHandler          ;< 5 GPIOA Interrupt Handler
                DCD     GPIOB_IRQHandler          ;< 6 GPIOB Interrupt Handler
                DCD     0                         ;< 7 Reserved
                DCD     0                         ;< 8 Reserved
                DCD     0                         ;< 9 Reserved
                DCD     0                         ;< 10 Reserved
                DCD     0                         ;< 11 Reserved
                DCD     ADC_IRQHandler            ;< 12 ADC Interrupt Handler
                DCD     ATIM_IRQHandler           ;< 13 ATIM Interrupt Handler
                DCD     VC1_IRQHandler            ;< 14 VC1 Interrupt Handler
                DCD     VC2_IRQHandler            ;< 15 VC2 Interrupt Handler
                DCD     GTIM1_IRQHandler          ;< 16 GTIM1 Interrupt Handler
                DCD     0                         ;< 17 Reserved
                DCD     0                         ;< 18 Reserved
                DCD     LPTIM_IRQHandler          ;< 19 LPTIM Interrupt Handler
                DCD     BTIM1_IRQHandler          ;< 20 BTIM1 Interrupt Handler
                DCD     BTIM2_IRQHandler          ;< 21 BTIM2 Interrupt Handler
                DCD     BTIM3_IRQHandler          ;< 22 BTIM3 Interrupt Handler
                DCD     I2C1_IRQHandler           ;< 23 I2C1  Interrupt Handler       
                DCD     0                         ;< 24 Reserved
                DCD     SPI1_IRQHandler           ;< 25 SPI1 Interrupt Handler
                DCD     0                         ;< 26 Reserved
                DCD     UART1_IRQHandler          ;< 27 UART1 Interrupt Handler
                DCD     UART2_IRQHandler          ;< 28 UART2 Interrupt Handler
                DCD     0                         ;< 29 Reserved
                DCD     0                         ;< 30 Reserved
                DCD     CLKFAULT_IRQHandler       ;< 31 CLKFAULT Interrupt Handler

                THUMB

                PUBWEAK Reset_Handler
                SECTION .text:CODE:NOROOT:REORDER(2)
Reset_Handler
                LDR     R0, =SystemInit
                BLX     R0
                LDR     R0, =__iar_program_start
                BX      R0

                PUBWEAK NMI_Handler
                SECTION .text:CODE:NOROOT:REORDER(1)
NMI_Handler
                B       NMI_Handler


                PUBWEAK HardFault_Handler
                SECTION .text:CODE:NOROOT:REORDER(1)
HardFault_Handler
                B       HardFault_Handler


                PUBWEAK SVC_Handler
                SECTION .text:CODE:NOROOT:REORDER(1)
SVC_Handler
                B       SVC_Handler


                PUBWEAK PendSV_Handler
                SECTION .text:CODE:NOROOT:REORDER(1)
PendSV_Handler
                B       PendSV_Handler


                PUBWEAK SysTick_Handler
                SECTION .text:CODE:NOROOT:REORDER(1)
SysTick_Handler
                B       SysTick_Handler


                PUBWEAK WDT_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
WDT_IRQHandler
                B       WDT_IRQHandler


                PUBWEAK LVD_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
LVD_IRQHandler
                B       LVD_IRQHandler


                PUBWEAK RTC_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
RTC_IRQHandler
                B       RTC_IRQHandler


                PUBWEAK FLASH_RAM_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
FLASH_RAM_IRQHandler
                B       FLASH_RAM_IRQHandler


                PUBWEAK SYSCTRL_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
SYSCTRL_IRQHandler
                B       SYSCTRL_IRQHandler


                PUBWEAK GPIOA_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
GPIOA_IRQHandler
                B       GPIOA_IRQHandler


                PUBWEAK GPIOB_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
GPIOB_IRQHandler
                B       GPIOB_IRQHandler


                PUBWEAK ADC_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
ADC_IRQHandler
                B       ADC_IRQHandler


                PUBWEAK ATIM_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
ATIM_IRQHandler
                B       ATIM_IRQHandler


                PUBWEAK VC1_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
VC1_IRQHandler
                B       VC1_IRQHandler


                PUBWEAK VC2_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
VC2_IRQHandler
                B       VC2_IRQHandler


                PUBWEAK GTIM1_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
GTIM1_IRQHandler
                B       GTIM1_IRQHandler


                PUBWEAK LPTIM_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
LPTIM_IRQHandler
                B       LPTIM_IRQHandler


                PUBWEAK BTIM1_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
BTIM1_IRQHandler
                B       BTIM1_IRQHandler


                PUBWEAK BTIM2_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
BTIM2_IRQHandler
                B       BTIM2_IRQHandler


                PUBWEAK BTIM3_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
BTIM3_IRQHandler
                B       BTIM3_IRQHandler


                PUBWEAK I2C1_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
I2C1_IRQHandler
                B       I2C1_IRQHandler


                PUBWEAK SPI1_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
SPI1_IRQHandler
                B       SPI1_IRQHandler


                PUBWEAK UART1_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
UART1_IRQHandler
                B       UART1_IRQHandler


                PUBWEAK UART2_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
UART2_IRQHandler
                B       UART2_IRQHandler


                PUBWEAK CLKFAULT_IRQHandler
                SECTION .text:CODE:NOROOT:REORDER(1)
CLKFAULT_IRQHandler
                B       CLKFAULT_IRQHandler



                END
